package com.four.basicinfo.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.four.basicinfo.entity.Document;
import com.four.basicinfo.entity.Information;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DocumentDao extends BaseMapper<Document> {
    /**
     * 查询证件信息
     *
     * @param id 证件信息主键
     * @return 证件信息
     */
    public Document selectDocumentById(Long id);

    //查询个人
    @Select("select id,number,creation_date as creationDate,notes,effective_date as effectiveDate,document_type as documentType,photo,document_num as documentNum," +
            "return_num as returnNum,state,custodian from document where number=#{number}")
    public List<Document> selectByNum(Integer number);
    /**
     * 新增证件信息
     *
     * @param document 证件信息
     * @return 结果
     */
    public int insertDocument(Document document);

    /**
     * 修改证件信息
     *
     * @param document 证件信息
     * @return 结果
     */
    public int updateDocument(Document document);

    /**
     * 删除证件信息
     *
     * @param id 证件信息主键
     * @return 结果
     */
    public int deleteDocumentById(Long id);
}
